package com.group.three.service.impl.myorderimpl;

import com.github.pagehelper.PageHelper;
import com.group.three.entity.myOrder.*;
import com.group.three.mapper.aftersale.AfterSaleMapper;
import com.group.three.service.myorderservice.AfterSaleReasonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class afterSaleReasonServiceImpl implements AfterSaleReasonService {
    @Autowired
    private AfterSaleMapper afterSaleMapper;

    @Override
    public List<AfterSaleReason> selectAfterSaleReasons(String serviceType) {
        return afterSaleMapper.selectAfterSaleReasons(serviceType);
    }

    @Override
    public List<AfterSaleSearchParams> selectAfterSale(String memberId, String keywords, int pageNumber, int pageSize) {
        PageHelper.startPage(pageNumber, pageSize);
        List<AfterSaleSearchParams> AfterSale = afterSaleMapper.selectAfterSale(memberId, keywords, pageNumber, pageSize);
        return AfterSale;
    }

    @Override
    public int cancelAfterSale(String afterSaleSn) {
        return afterSaleMapper.cancelAfterSale(afterSaleSn);
    }

    @Override
    public AfterSaleSearchParams AfterSaleItem(String sn) {
        return afterSaleMapper.AfterSaleItem(sn);
    }

    @Override
    public  List<AfterSaleLog> getAfterSaleLog(String sn) {
        return afterSaleMapper.getAfterSaleLog(sn);
    }

    @Override
    public AfterSaleApplyVO getAfterSaleInfo(String sn) {
        return afterSaleMapper.getAfterSaleInfo(sn);
    }

    @Override
    public int saveAfterSale(AfterSaleDTO afterSaleDTO) {
        return afterSaleMapper.saveAfterSale(afterSaleDTO);
    }
}
